package cn.qj.ymcc.controller;

import cn.qj.ymcc.doc.CourseDoc;
import cn.qj.ymcc.dto.CourseSearchDto;
import cn.qj.ymcc.result.JSONResult;
import cn.qj.ymcc.result.PageList;
import cn.qj.ymcc.service.ESCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/course")
public class ESCourseSearchController {
    @Autowired
    private ESCourseService esCourseService;
    @PostMapping("/search")
    public JSONResult search(@RequestBody CourseSearchDto courseSearchDto) {
        PageList<CourseDoc> CourseDocs = esCourseService.search(courseSearchDto);
        return JSONResult.success(CourseDocs);
    }
}
